-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ESLint #728
base: main
Are you sure you want to change the base?
Add ESLint #728
Conversation
@cressie176 Could you please take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to the comments, what do you think about a future PR which uses https://www.npmjs.com/package/lint-staged to only check staged files, and potentially running automatically on a commit hook? I'm conscious the more dependencies we add, the more maintenance we incur though.
"caughtErrorsIgnorePattern": "^_" | ||
} | ||
], | ||
"no-cond-assign": "warn", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we change this to "off" given it's used fairly extensively. Warnings are just annoying.
@@ -179,6 +179,7 @@ class Channel extends BaseChannel { | |||
this.unregisterConsumer(consumerTag); | |||
return ok.fields; | |||
}); | |||
return ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning ok looks like a change in behaviour. Was this previously an omission or just made to appease a linting rule?
What does the Basic Cancel RPC return?
Were the api docs updated?
@@ -105,7 +105,7 @@ function encodeFieldValue(buffer, value, offset) { | |||
var start = offset; | |||
var type = typeof value, val = value; | |||
// A trapdoor for specifying a type, e.g., timestamp | |||
if (value && type === 'object' && value.hasOwnProperty('!')) { | |||
if (value && type === 'object' && Object.prototype.hasOwnProperty.call(value, '!')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes I hate javascript!
"mocha": "^9.2.2", | ||
"nyc": "^15.1.0", | ||
"uglify-js": "2.8.x" | ||
}, | ||
"scripts": { | ||
"test": "make test", | ||
"lint": "eslint \"lib/**/*.js\" channel_api.js callback_api.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this catch the generated files? Maybe they should also be ignored (although if they pass, no harm being done currently).
No description provided.